# -*- coding: utf-8 -*-
# @description: 
# @File  : demo.py
# @Time  :2022-09-16 17:27:43
# @Author:selfeasy
# @Email :selfeasy@qq.com

token = "gBp3qrkeWrOH0iDxP+p0ZTC4Qv31kvnhpK/s7vrRihmO7Fy46POAMKvNJblHIrX+kfB9Laxiv9O/iDP0aNJe6UYpc8k32WFeoTSgho2VeA0kYRAVO4Q+KXReBuk9VkB64IPiCy7jArD5XuantlJOkpOEpQGtYYphMh7d5N0cBQM=";

from Cryptodome.PublicKey import RSA
from Cryptodome.Cipher import PKCS1_v1_5 as Cipher_PKC
import base64

def decrypt(en_data):
    #base64解码
    base64_data = base64.b64decode(en_data.encode('utf-8'))
    format='-----BEGIN PRIVATE KEY-----\n{}\n-----END PRIVATE KEY-----'
    data='MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAMxjkuKe451vdearSZn1epnQ3G74y3F83B1jiwvO+XbH7BwMtO4tbN84+WTzUKO1RHScFZB7spwkeu7kGT/JSTVASdSE2p19ACs4kd6VG7s/XTeEeZ8VNvzUG68jxG13bhrwHm3vNX3wOjAHk1O5318ZBjp60llo76EjryrLDNYjAgMBAAECgYAnbFlrrtwWhOZH7OgQc0IHozqxiPms1TmbzZSHXY/Osnc/XdAUVNy4HcQ1DZ2TRiaDG4wpR0LHTV4M8CBSpl+hNoYNJQidFJ0hgGDcvnvThQja3biw9O/85Ra5gtodbXe1pesVRZ2DjNxHKLXiBp6HrxcugbAT+gCX74wD/f7usQJBAO8Rtb6PEEI/PSnnsolLslqvGodOQQe6bi8CtfLJOmbQ4TD3ggMMZ6sTn/Xof/iHn5heJoIwGK7zk6dEcNj1/DkCQQDa3R3NANdi2PIodTY0lnWgce13lCz9nEZI1tHUs9PKLSvclT+MHJajHxG9cLC1ujR7t8f4QecXaestULZhk107AkEAqbz2QDUNQyvpPk5+aZKwMEiw2i6KZ3VLc99F1fpfl85ohL7GtWliVYnagdswuQF6I9F9H+QMMnNIe3NReAm2qQJBAMTiAqvnJNrEBFtGzcNS0m/J7PAUOMDP8x4VOV9ZgZ0vM3TUQf09vnjxOxkqpZxk7E+bDOWUC1mxq6DxKY/va/8CQCVghAsi6vITG0M0PhFV1gmRS187VKSjuj9J9tyzub8iEZzNnDsiyphDEt7YatEoM2HexLVFy5Xk7zmMZgqGJDU='
    # data='MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAL6YEEx6j2z2y9oE2x4/kBh22e2gODpYn3SkcmcxRAqv+qIETs/07FsflcbBdFcDWofU46Gq3V5HMkz36TxI+AV6no1+6VrdODplShWNA6nCWUROYzI4nldPuCJ3y1h+g4tn5ib20aYId2Tp9O+dYA/SjCcPIFnzvlW+oVGciaHhAgMBAAECgYBhhfGhEH1fJhE854svORsESZxNSNQ8lqhQyOx4/O5yAYXfbRDeu9ZM8iZzYv2ioGasZjRrvsAyw39rftbrL/MoB5tukQVpNgdFJLOxi9LutlvtcT/6Rjb7P/Apvx3D0zpQ3yBZ20NOmJxQJPW0exCXfiAuDJTQ5xa3zmXFM1G72QJBAPFZKoCJcPDUonPvkHKIy20X8garyvENj38BiOy9kHK0sPSGmH+3G5WE+uwQ8Si9LDS9giF/GmMDrwMWmIu3TjMCQQDKKh3XTcYEYwUIkekg272K5v82d8jysikghigThhJNccc/aBlgkwmh/wj0DyFtzaKw6Pr5LmPzLj04umiAwpObAkAGktAmihfKZ3A5SigcBn/L6+AKsHkpkZ377pXFJPCfPy6mqlfS+rDEpMeU0G1RF73xfcvij6yvT7Vflyj2fTqjAkAykXBfb6PNaxtSNnUy8+Qof3ltHW9VTb091nDl2U5wsrodISPf5UeujsWljrdU6O/+AnjspW744CMOMop7UrBrAkAzDUbTQ0T+Y5FfHbonwt9jkzf/0FCFO+qCDOYrwdiiFD/RAsnjnFgeqt7hugHGemNz+0ZY5fHrRx4x+saKgL66'
    
    #读取私钥
    # private_key = RSA.import_key(open('./data/t.pem').read())
    private_key = RSA.import_key(format.format(data))

    #解密
    cipher_rsa = Cipher_PKC.new(private_key)
    data = cipher_rsa.decrypt(base64_data,'')
    print(data)

    return data.decode()



data = decrypt(token)
print(data=='')

a='1663310078+208156836658167809+aaaaa201'

# def encrypt(message):
